#ifndef _ROS_learning_test_ADCS_h
#define _ROS_learning_test_ADCS_h

#include <stdint.h>
#include <string.h>
#include <stdlib.h>
#include "ros/msg.h"

namespace learning_test
{

  class ADCS : public ros::Msg
  {
    public:
      typedef int16_t _wheel1_speed_type;
      _wheel1_speed_type wheel1_speed;
      typedef bool _wheel1_forward_type;
      _wheel1_forward_type wheel1_forward;
      typedef int16_t _wheel2_speed_type;
      _wheel2_speed_type wheel2_speed;
      typedef bool _wheel2_forward_type;
      _wheel2_forward_type wheel2_forward;
      typedef int16_t _wheel3_speed_type;
      _wheel3_speed_type wheel3_speed;
      typedef bool _wheel3_forward_type;
      _wheel3_forward_type wheel3_forward;
      typedef int16_t _wheel4_speed_type;
      _wheel4_speed_type wheel4_speed;
      typedef bool _wheel4_forward_type;
      _wheel4_forward_type wheel4_forward;
      typedef uint16_t _x_mag_type;
      _x_mag_type x_mag;
      typedef bool _x_mag_forward_type;
      _x_mag_forward_type x_mag_forward;
      typedef uint16_t _y_mag_type;
      _y_mag_type y_mag;
      typedef bool _y_mag_forward_type;
      _y_mag_forward_type y_mag_forward;
      typedef uint16_t _z_mag_type;
      _z_mag_type z_mag;
      typedef bool _z_mag_forward_type;
      _z_mag_forward_type z_mag_forward;
      typedef float _x_euler_type;
      _x_euler_type x_euler;
      typedef float _y_euler_type;
      _y_euler_type y_euler;
      typedef float _z_euler_type;
      _z_euler_type z_euler;
      typedef float _x_angular_velocity_type;
      _x_angular_velocity_type x_angular_velocity;
      typedef float _y_angular_velocity_type;
      _y_angular_velocity_type y_angular_velocity;
      typedef float _z_angular_velocity_type;
      _z_angular_velocity_type z_angular_velocity;
      typedef float _x_acceleration_type;
      _x_acceleration_type x_acceleration;
      typedef float _y_acceleration_type;
      _y_acceleration_type y_acceleration;
      typedef float _z_acceleration_type;
      _z_acceleration_type z_acceleration;

    ADCS():
      wheel1_speed(0),
      wheel1_forward(0),
      wheel2_speed(0),
      wheel2_forward(0),
      wheel3_speed(0),
      wheel3_forward(0),
      wheel4_speed(0),
      wheel4_forward(0),
      x_mag(0),
      x_mag_forward(0),
      y_mag(0),
      y_mag_forward(0),
      z_mag(0),
      z_mag_forward(0),
      x_euler(0),
      y_euler(0),
      z_euler(0),
      x_angular_velocity(0),
      y_angular_velocity(0),
      z_angular_velocity(0),
      x_acceleration(0),
      y_acceleration(0),
      z_acceleration(0)
    {
    }

    virtual int serialize(unsigned char *outbuffer) const override
    {
      int offset = 0;
      union {
        int16_t real;
        uint16_t base;
      } u_wheel1_speed;
      u_wheel1_speed.real = this->wheel1_speed;
      *(outbuffer + offset + 0) = (u_wheel1_speed.base >> (8 * 0)) & 0xFF;
      *(outbuffer + offset + 1) = (u_wheel1_speed.base >> (8 * 1)) & 0xFF;
      offset += sizeof(this->wheel1_speed);
      union {
        bool real;
        uint8_t base;
      } u_wheel1_forward;
      u_wheel1_forward.real = this->wheel1_forward;
      *(outbuffer + offset + 0) = (u_wheel1_forward.base >> (8 * 0)) & 0xFF;
      offset += sizeof(this->wheel1_forward);
      union {
        int16_t real;
        uint16_t base;
      } u_wheel2_speed;
      u_wheel2_speed.real = this->wheel2_speed;
      *(outbuffer + offset + 0) = (u_wheel2_speed.base >> (8 * 0)) & 0xFF;
      *(outbuffer + offset + 1) = (u_wheel2_speed.base >> (8 * 1)) & 0xFF;
      offset += sizeof(this->wheel2_speed);
      union {
        bool real;
        uint8_t base;
      } u_wheel2_forward;
      u_wheel2_forward.real = this->wheel2_forward;
      *(outbuffer + offset + 0) = (u_wheel2_forward.base >> (8 * 0)) & 0xFF;
      offset += sizeof(this->wheel2_forward);
      union {
        int16_t real;
        uint16_t base;
      } u_wheel3_speed;
      u_wheel3_speed.real = this->wheel3_speed;
      *(outbuffer + offset + 0) = (u_wheel3_speed.base >> (8 * 0)) & 0xFF;
      *(outbuffer + offset + 1) = (u_wheel3_speed.base >> (8 * 1)) & 0xFF;
      offset += sizeof(this->wheel3_speed);
      union {
        bool real;
        uint8_t base;
      } u_wheel3_forward;
      u_wheel3_forward.real = this->wheel3_forward;
      *(outbuffer + offset + 0) = (u_wheel3_forward.base >> (8 * 0)) & 0xFF;
      offset += sizeof(this->wheel3_forward);
      union {
        int16_t real;
        uint16_t base;
      } u_wheel4_speed;
      u_wheel4_speed.real = this->wheel4_speed;
      *(outbuffer + offset + 0) = (u_wheel4_speed.base >> (8 * 0)) & 0xFF;
      *(outbuffer + offset + 1) = (u_wheel4_speed.base >> (8 * 1)) & 0xFF;
      offset += sizeof(this->wheel4_speed);
      union {
        bool real;
        uint8_t base;
      } u_wheel4_forward;
      u_wheel4_forward.real = this->wheel4_forward;
      *(outbuffer + offset + 0) = (u_wheel4_forward.base >> (8 * 0)) & 0xFF;
      offset += sizeof(this->wheel4_forward);
      *(outbuffer + offset + 0) = (this->x_mag >> (8 * 0)) & 0xFF;
      *(outbuffer + offset + 1) = (this->x_mag >> (8 * 1)) & 0xFF;
      offset += sizeof(this->x_mag);
      union {
        bool real;
        uint8_t base;
      } u_x_mag_forward;
      u_x_mag_forward.real = this->x_mag_forward;
      *(outbuffer + offset + 0) = (u_x_mag_forward.base >> (8 * 0)) & 0xFF;
      offset += sizeof(this->x_mag_forward);
      *(outbuffer + offset + 0) = (this->y_mag >> (8 * 0)) & 0xFF;
      *(outbuffer + offset + 1) = (this->y_mag >> (8 * 1)) & 0xFF;
      offset += sizeof(this->y_mag);
      union {
        bool real;
        uint8_t base;
      } u_y_mag_forward;
      u_y_mag_forward.real = this->y_mag_forward;
      *(outbuffer + offset + 0) = (u_y_mag_forward.base >> (8 * 0)) & 0xFF;
      offset += sizeof(this->y_mag_forward);
      *(outbuffer + offset + 0) = (this->z_mag >> (8 * 0)) & 0xFF;
      *(outbuffer + offset + 1) = (this->z_mag >> (8 * 1)) & 0xFF;
      offset += sizeof(this->z_mag);
      union {
        bool real;
        uint8_t base;
      } u_z_mag_forward;
      u_z_mag_forward.real = this->z_mag_forward;
      *(outbuffer + offset + 0) = (u_z_mag_forward.base >> (8 * 0)) & 0xFF;
      offset += sizeof(this->z_mag_forward);
      union {
        float real;
        uint32_t base;
      } u_x_euler;
      u_x_euler.real = this->x_euler;
      *(outbuffer + offset + 0) = (u_x_euler.base >> (8 * 0)) & 0xFF;
      *(outbuffer + offset + 1) = (u_x_euler.base >> (8 * 1)) & 0xFF;
      *(outbuffer + offset + 2) = (u_x_euler.base >> (8 * 2)) & 0xFF;
      *(outbuffer + offset + 3) = (u_x_euler.base >> (8 * 3)) & 0xFF;
      offset += sizeof(this->x_euler);
      union {
        float real;
        uint32_t base;
      } u_y_euler;
      u_y_euler.real = this->y_euler;
      *(outbuffer + offset + 0) = (u_y_euler.base >> (8 * 0)) & 0xFF;
      *(outbuffer + offset + 1) = (u_y_euler.base >> (8 * 1)) & 0xFF;
      *(outbuffer + offset + 2) = (u_y_euler.base >> (8 * 2)) & 0xFF;
      *(outbuffer + offset + 3) = (u_y_euler.base >> (8 * 3)) & 0xFF;
      offset += sizeof(this->y_euler);
      union {
        float real;
        uint32_t base;
      } u_z_euler;
      u_z_euler.real = this->z_euler;
      *(outbuffer + offset + 0) = (u_z_euler.base >> (8 * 0)) & 0xFF;
      *(outbuffer + offset + 1) = (u_z_euler.base >> (8 * 1)) & 0xFF;
      *(outbuffer + offset + 2) = (u_z_euler.base >> (8 * 2)) & 0xFF;
      *(outbuffer + offset + 3) = (u_z_euler.base >> (8 * 3)) & 0xFF;
      offset += sizeof(this->z_euler);
      union {
        float real;
        uint32_t base;
      } u_x_angular_velocity;
      u_x_angular_velocity.real = this->x_angular_velocity;
      *(outbuffer + offset + 0) = (u_x_angular_velocity.base >> (8 * 0)) & 0xFF;
      *(outbuffer + offset + 1) = (u_x_angular_velocity.base >> (8 * 1)) & 0xFF;
      *(outbuffer + offset + 2) = (u_x_angular_velocity.base >> (8 * 2)) & 0xFF;
      *(outbuffer + offset + 3) = (u_x_angular_velocity.base >> (8 * 3)) & 0xFF;
      offset += sizeof(this->x_angular_velocity);
      union {
        float real;
        uint32_t base;
      } u_y_angular_velocity;
      u_y_angular_velocity.real = this->y_angular_velocity;
      *(outbuffer + offset + 0) = (u_y_angular_velocity.base >> (8 * 0)) & 0xFF;
      *(outbuffer + offset + 1) = (u_y_angular_velocity.base >> (8 * 1)) & 0xFF;
      *(outbuffer + offset + 2) = (u_y_angular_velocity.base >> (8 * 2)) & 0xFF;
      *(outbuffer + offset + 3) = (u_y_angular_velocity.base >> (8 * 3)) & 0xFF;
      offset += sizeof(this->y_angular_velocity);
      union {
        float real;
        uint32_t base;
      } u_z_angular_velocity;
      u_z_angular_velocity.real = this->z_angular_velocity;
      *(outbuffer + offset + 0) = (u_z_angular_velocity.base >> (8 * 0)) & 0xFF;
      *(outbuffer + offset + 1) = (u_z_angular_velocity.base >> (8 * 1)) & 0xFF;
      *(outbuffer + offset + 2) = (u_z_angular_velocity.base >> (8 * 2)) & 0xFF;
      *(outbuffer + offset + 3) = (u_z_angular_velocity.base >> (8 * 3)) & 0xFF;
      offset += sizeof(this->z_angular_velocity);
      union {
        float real;
        uint32_t base;
      } u_x_acceleration;
      u_x_acceleration.real = this->x_acceleration;
      *(outbuffer + offset + 0) = (u_x_acceleration.base >> (8 * 0)) & 0xFF;
      *(outbuffer + offset + 1) = (u_x_acceleration.base >> (8 * 1)) & 0xFF;
      *(outbuffer + offset + 2) = (u_x_acceleration.base >> (8 * 2)) & 0xFF;
      *(outbuffer + offset + 3) = (u_x_acceleration.base >> (8 * 3)) & 0xFF;
      offset += sizeof(this->x_acceleration);
      union {
        float real;
        uint32_t base;
      } u_y_acceleration;
      u_y_acceleration.real = this->y_acceleration;
      *(outbuffer + offset + 0) = (u_y_acceleration.base >> (8 * 0)) & 0xFF;
      *(outbuffer + offset + 1) = (u_y_acceleration.base >> (8 * 1)) & 0xFF;
      *(outbuffer + offset + 2) = (u_y_acceleration.base >> (8 * 2)) & 0xFF;
      *(outbuffer + offset + 3) = (u_y_acceleration.base >> (8 * 3)) & 0xFF;
      offset += sizeof(this->y_acceleration);
      union {
        float real;
        uint32_t base;
      } u_z_acceleration;
      u_z_acceleration.real = this->z_acceleration;
      *(outbuffer + offset + 0) = (u_z_acceleration.base >> (8 * 0)) & 0xFF;
      *(outbuffer + offset + 1) = (u_z_acceleration.base >> (8 * 1)) & 0xFF;
      *(outbuffer + offset + 2) = (u_z_acceleration.base >> (8 * 2)) & 0xFF;
      *(outbuffer + offset + 3) = (u_z_acceleration.base >> (8 * 3)) & 0xFF;
      offset += sizeof(this->z_acceleration);
      return offset;
    }

    virtual int deserialize(unsigned char *inbuffer) override
    {
      int offset = 0;
      union {
        int16_t real;
        uint16_t base;
      } u_wheel1_speed;
      u_wheel1_speed.base = 0;
      u_wheel1_speed.base |= ((uint16_t) (*(inbuffer + offset + 0))) << (8 * 0);
      u_wheel1_speed.base |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1);
      this->wheel1_speed = u_wheel1_speed.real;
      offset += sizeof(this->wheel1_speed);
      union {
        bool real;
        uint8_t base;
      } u_wheel1_forward;
      u_wheel1_forward.base = 0;
      u_wheel1_forward.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0);
      this->wheel1_forward = u_wheel1_forward.real;
      offset += sizeof(this->wheel1_forward);
      union {
        int16_t real;
        uint16_t base;
      } u_wheel2_speed;
      u_wheel2_speed.base = 0;
      u_wheel2_speed.base |= ((uint16_t) (*(inbuffer + offset + 0))) << (8 * 0);
      u_wheel2_speed.base |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1);
      this->wheel2_speed = u_wheel2_speed.real;
      offset += sizeof(this->wheel2_speed);
      union {
        bool real;
        uint8_t base;
      } u_wheel2_forward;
      u_wheel2_forward.base = 0;
      u_wheel2_forward.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0);
      this->wheel2_forward = u_wheel2_forward.real;
      offset += sizeof(this->wheel2_forward);
      union {
        int16_t real;
        uint16_t base;
      } u_wheel3_speed;
      u_wheel3_speed.base = 0;
      u_wheel3_speed.base |= ((uint16_t) (*(inbuffer + offset + 0))) << (8 * 0);
      u_wheel3_speed.base |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1);
      this->wheel3_speed = u_wheel3_speed.real;
      offset += sizeof(this->wheel3_speed);
      union {
        bool real;
        uint8_t base;
      } u_wheel3_forward;
      u_wheel3_forward.base = 0;
      u_wheel3_forward.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0);
      this->wheel3_forward = u_wheel3_forward.real;
      offset += sizeof(this->wheel3_forward);
      union {
        int16_t real;
        uint16_t base;
      } u_wheel4_speed;
      u_wheel4_speed.base = 0;
      u_wheel4_speed.base |= ((uint16_t) (*(inbuffer + offset + 0))) << (8 * 0);
      u_wheel4_speed.base |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1);
      this->wheel4_speed = u_wheel4_speed.real;
      offset += sizeof(this->wheel4_speed);
      union {
        bool real;
        uint8_t base;
      } u_wheel4_forward;
      u_wheel4_forward.base = 0;
      u_wheel4_forward.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0);
      this->wheel4_forward = u_wheel4_forward.real;
      offset += sizeof(this->wheel4_forward);
      this->x_mag =  ((uint16_t) (*(inbuffer + offset)));
      this->x_mag |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1);
      offset += sizeof(this->x_mag);
      union {
        bool real;
        uint8_t base;
      } u_x_mag_forward;
      u_x_mag_forward.base = 0;
      u_x_mag_forward.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0);
      this->x_mag_forward = u_x_mag_forward.real;
      offset += sizeof(this->x_mag_forward);
      this->y_mag =  ((uint16_t) (*(inbuffer + offset)));
      this->y_mag |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1);
      offset += sizeof(this->y_mag);
      union {
        bool real;
        uint8_t base;
      } u_y_mag_forward;
      u_y_mag_forward.base = 0;
      u_y_mag_forward.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0);
      this->y_mag_forward = u_y_mag_forward.real;
      offset += sizeof(this->y_mag_forward);
      this->z_mag =  ((uint16_t) (*(inbuffer + offset)));
      this->z_mag |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1);
      offset += sizeof(this->z_mag);
      union {
        bool real;
        uint8_t base;
      } u_z_mag_forward;
      u_z_mag_forward.base = 0;
      u_z_mag_forward.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0);
      this->z_mag_forward = u_z_mag_forward.real;
      offset += sizeof(this->z_mag_forward);
      union {
        float real;
        uint32_t base;
      } u_x_euler;
      u_x_euler.base = 0;
      u_x_euler.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
      u_x_euler.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
      u_x_euler.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
      u_x_euler.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
      this->x_euler = u_x_euler.real;
      offset += sizeof(this->x_euler);
      union {
        float real;
        uint32_t base;
      } u_y_euler;
      u_y_euler.base = 0;
      u_y_euler.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
      u_y_euler.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
      u_y_euler.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
      u_y_euler.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
      this->y_euler = u_y_euler.real;
      offset += sizeof(this->y_euler);
      union {
        float real;
        uint32_t base;
      } u_z_euler;
      u_z_euler.base = 0;
      u_z_euler.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
      u_z_euler.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
      u_z_euler.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
      u_z_euler.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
      this->z_euler = u_z_euler.real;
      offset += sizeof(this->z_euler);
      union {
        float real;
        uint32_t base;
      } u_x_angular_velocity;
      u_x_angular_velocity.base = 0;
      u_x_angular_velocity.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
      u_x_angular_velocity.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
      u_x_angular_velocity.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
      u_x_angular_velocity.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
      this->x_angular_velocity = u_x_angular_velocity.real;
      offset += sizeof(this->x_angular_velocity);
      union {
        float real;
        uint32_t base;
      } u_y_angular_velocity;
      u_y_angular_velocity.base = 0;
      u_y_angular_velocity.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
      u_y_angular_velocity.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
      u_y_angular_velocity.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
      u_y_angular_velocity.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
      this->y_angular_velocity = u_y_angular_velocity.real;
      offset += sizeof(this->y_angular_velocity);
      union {
        float real;
        uint32_t base;
      } u_z_angular_velocity;
      u_z_angular_velocity.base = 0;
      u_z_angular_velocity.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
      u_z_angular_velocity.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
      u_z_angular_velocity.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
      u_z_angular_velocity.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
      this->z_angular_velocity = u_z_angular_velocity.real;
      offset += sizeof(this->z_angular_velocity);
      union {
        float real;
        uint32_t base;
      } u_x_acceleration;
      u_x_acceleration.base = 0;
      u_x_acceleration.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
      u_x_acceleration.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
      u_x_acceleration.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
      u_x_acceleration.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
      this->x_acceleration = u_x_acceleration.real;
      offset += sizeof(this->x_acceleration);
      union {
        float real;
        uint32_t base;
      } u_y_acceleration;
      u_y_acceleration.base = 0;
      u_y_acceleration.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
      u_y_acceleration.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
      u_y_acceleration.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
      u_y_acceleration.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
      this->y_acceleration = u_y_acceleration.real;
      offset += sizeof(this->y_acceleration);
      union {
        float real;
        uint32_t base;
      } u_z_acceleration;
      u_z_acceleration.base = 0;
      u_z_acceleration.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
      u_z_acceleration.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
      u_z_acceleration.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
      u_z_acceleration.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
      this->z_acceleration = u_z_acceleration.real;
      offset += sizeof(this->z_acceleration);
     return offset;
    }

    virtual const char * getType() override { return "learning_test/ADCS"; };
    virtual const char * getMD5() override { return "4645216b7b6aa986a8a24f6f24320517"; };

  };

}
#endif
